package com.hzhc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hzhc.entity.CntrLog;
import com.hzhc.entity.TrainPlanDetail;
import com.hzhc.vo.CntrLogVo;
import com.hzhc.vo.DataAnalyVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 集装箱日志表 Mapper 接口
 * </p>
 *
 * @author 功不唐捐
 * @since 2024-05-23
 */
public interface CntrLogMapper extends BaseMapper<CntrLog> {

    List<CntrLogVo> productionList(@Param("year") String year,@Param("companyId")String companyId);

    List<CntrLogVo> selectSiteTallyList(Page<CntrLogVo> page,@Param("vo") CntrLogVo vo);

    @MapKey("planTime")
    Map<String, Map<String, Long>> selectXcData(CntrLogVo vo,@Param("year")String year);

    @MapKey("planTime")
    Map<String, Map<String, Long>> selectZcData(CntrLogVo vo,@Param("year")String year);

    @MapKey("planTime")
    Map<String, Map<String, Long>> selectSxData(CntrLogVo vo,@Param("year")String year);

    @MapKey("planTime")
    Map<String, Map<String, Long>> selectTxData(CntrLogVo vo,@Param("year")String year);

    IPage<CntrLogVo> selectCntrLogPage(Page<CntrLogVo> pagination,@Param("cntrLog") CntrLogVo cntrLog);

    IPage<CntrLogVo> selectYzsCntrLogPage(Page<CntrLogVo> pagination,@Param("cntrLog") CntrLogVo cntrLog);

    @MapKey("month")
    Map<String, Map<String, BigDecimal>> selectTotal(@Param("start") LocalDate start, @Param("end") LocalDate end);

    List<DataAnalyVo> selectTeuTotal(@Param("vo") DataAnalyVo vo);

    List<CntrLogVo> getTodayTPS();

    CntrLog selectMsgByCntr(@Param("vo") TrainPlanDetail detail );

    CntrLog getByCntrNoAndOrderNo(@Param("cntrNo") String cntrNo,@Param("orderNo") String orderNo);

}
